import 'package:ai/util/CommonUtils.dart';
import 'package:flutter/material.dart';

class RankItem extends StatelessWidget {
  final String title;

  final int rank;

  const RankItem({super.key, required this.title, required this.rank});

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.start,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Stack(
          alignment: Alignment.topCenter,
          children: [
            CommonUtils.getImageAsset("hot_search_rv_item_bg",width: 32),
            Positioned(
              top: 3,
              child: Text(
                "$rank",
                style: const TextStyle(
                  color: Colors.white,
                ),
              ),
            ),
          ],
        ),
        const SizedBox(
          width: 8,
        ),
        Container(
          padding: const EdgeInsets.only(top: 1),
          child: Text(
            title,
            style: const TextStyle(
              fontSize: 16,
            ),
          ),
        )
      ],
    );
  }
}
